{% extends "base.html" %}

{% block content %}
<div class="container mt-5">
    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card">
                <div class="card-header">
                    <h3 class="text-center">Login</h3>
                </div>
                <div class="card-body">
                    {% if form.errors %}
                    <div class="alert alert-danger">
                        Your username and password didn't match. Please try again.
                    </div>
                    {% endif %}
                    
                    <form method="post" action="{% url 'login' %}">
                        {% csrf_token %}
                        <div class="mb-3">
                            <label for="id_username" class="form-label">Username</label>
                            <input type="text" name="username" class="form-control" id="id_username" required>
                        </div>
                        <div class="mb-3">
                            <label for="id_password" class="form-label">Password</label>
                            <input type="password" name="password" class="form-control" id="id_password" required>
                        </div>
                        <button type="submit" class="btn btn-primary w-100">Login</button>
                        <input type="hidden" name="next" value="{{ next }}">
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}